Skip to content

[codex] Refactor A5 tile examples around PTO opcodes#3

Merged
zhoubot merged 2 commits into
mainfrom
codex/ptodsl-a5-lib
Mar 31, 2026
Merged

[codex] Refactor A5 tile examples around PTO opcodes#3
zhoubot merged 2 commits into
mainfrom
codex/ptodsl-a5-lib

Conversation

@zhoubot
Copy link
Copy Markdown

@zhoubot zhoubot commented Mar 31, 2026

Summary

  • split the A5 tile-to-micro library into small opcode-focused modules such as tbinary.py, tunary.py, texpand.py, treduce.py, and tsort.py
  • expose the public A5 surface with t... helpers like tadd, trow_sum, and tgather, and rename the generated vector-copy example to a5_vector_copy
  • refresh the A5 docs, coverage checklist, generated .pto artifacts, and regression tests around the new layout

Details

  • tadd and the other tile helpers now read as direct PTO micro-instruction examples, for example pto.vlds -> pto.vadd -> pto.vsts
  • shared A5 helper logic moved into _common.py, while remaining direct tile/cube wrappers live in native.py
  • wrapper interop in ptodsl.language and ptodsl.api.scalar now accepts any object with .raw, which lets the split A5 helpers work cleanly with this PTO-ISA fork's builder surface

Validation

  • PYTHONPATH=... python -m pytest -q tests/regression/test_a5_lib_regression.py tests/regression/test_tile_micro_coverage.py
  • result: 27 passed in 0.40s
  • PYTHONPATH=... python scripts/generate_a5_pto.py

@zhoubot zhoubot marked this pull request as ready for review March 31, 2026 02:14
@zhoubot zhoubot merged commit 8eabf83 into main Mar 31, 2026
5 checks passed
@zhoubot zhoubot deleted the codex/ptodsl-a5-lib branch March 31, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant